package fms.model;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

/**
 *
 * <P>FileName: Grib2WdInfo.java
 * <P>Description: GRIB2风温信息
 *                 SpringDataJPA在使用用户指定的序列创建插入数据时，效率比较高
 * <P>Version: v1.0
 * <P>History:
 */
@Entity
@Table(name="GRIB2_WD_INFO")
@SequenceGenerator(name="grib2SEQ",sequenceName="GRIB2_WD_SEQ")
public class Grib2WdInfo implements Serializable, Cloneable {

    // 自增长主键
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="grib2SEQ")
    private int id;

    // 开始时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "start_time", nullable = false)
    private Date startTime;

    //结束时间
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "end_time", nullable = false)
    private Date endTime;

    //风类型
    @Column(name = "wind_type", nullable = false, length = 10)
    private String windType;

    //大气压强
    @Column(name = "atmos_pressure", nullable = false, precision=10 ,scale = 0)
    private BigInteger atmosPressure;

    //经度
    @Column(name = "lon", nullable = false, precision = 10, scale = 3)
    private BigDecimal lon;

    //纬度
    @Column(name = "lat", nullable = false, precision = 10, scale = 3)
    private BigDecimal lat;

    //风速
    @Column(name = "wind_vel", nullable = false, precision = 10, scale = 3)
    private BigDecimal windVel;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getWindType() {
        return windType;
    }

    public void setWindType(String windType) {
        this.windType = windType;
    }

    public BigInteger getAtmosPressure() {
        return atmosPressure;
    }

    public void setAtmosPressure(BigInteger atmosPressure) {
        this.atmosPressure = atmosPressure;
    }

    public BigDecimal getLon() {
        return lon;
    }

    public void setLon(BigDecimal lon) {
        this.lon = lon;
    }

    public BigDecimal getLat() {
        return lat;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public BigDecimal getWindVel() {
        return windVel;
    }

    public void setWindVel(BigDecimal windVel) {
        this.windVel = windVel;
    }

    @Override
    public String toString() {
        return "Grib2WdInfo{" +
                "id=" + id +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", windType='" + windType + '\'' +
                ", atmosPressure=" + atmosPressure +
                ", lon=" + lon +
                ", lat=" + lat +
                ", windVel=" + windVel +
                '}';
    }
    @Override
    public Object clone() {
        Grib2WdInfo o = null;
        try {
            o = (Grib2WdInfo) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }
//    public static void main(String args[]) {
//        Grib2WdInfo a1 = new Grib2WdInfo();
//        Grib2WdInfo a2 = new Grib2WdInfo();
//
//        a1.setWindType("123");
//
//    }
}
